package com.cloudkinto.service.workOrder;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.workOrder.WorkOrderAddBo;
import com.cloudkinto.bo.workOrder.WorkOrderQueryBo;
import com.cloudkinto.bo.workOrder.WorkOrderUpdateBo;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.WorkOrderDo;
import com.cloudkinto.vo.workOrder.WorkOrderDetail;
import com.cloudkinto.vo.workOrder.WorkOrderVo;

import java.util.Map;

/**
 * <p>
 * 工单 service接口
 * </p>
 *
 * @author long
 * @since 2025-01-07
 */
public interface WorkOrderService extends IService<WorkOrderDo> {

    int add(WorkOrderAddBo req, Long userId, String username);

    int update(WorkOrderUpdateBo req, Long userId, String username);

    WorkOrderDetail detail(Long id);

    boolean cancel(Long id, Long userId, String username);

    boolean refuse(Long id, Long currentUserId, String userName);

    boolean approvePass(Long id, Long userId, String username);

    boolean solveFinish(Long id, Long userId, String username);

    boolean settlementWorkOrder(Long id, Long tenantId, Long userId, String username);

    SingleResult pageInit(Long userId, Long tenantId, Long companyId, String source);

    PageResult<WorkOrderVo> getListPage(WorkOrderQueryBo bo);

    SingleResult<Map<Integer, Integer>> listPageStatusSta(WorkOrderQueryBo bo);
}
